local gamelib = require "club.threecard.gamelib"
local game = require "club.threecard.bjracing"
local LoopScrollList = require "blaze.ui.widget.LoopScrollList"
local rank_item = game.require "gameui.settlement.rank_item"

local rank_list = gamelib.ui.element()

function rank_list:ctor()
    self.res = "club.threecard.bjracing/ui/settlement.b:rank_list";

    self.list = LoopScrollList.new();
    self.list.res = "club.threecard.bjracing/ui/settlement.b:rank_item";
    self.list.create_item = function(_, data, index) return rank_item.new(data) end;
end

function rank_list:load()
    self.list:load();
    self:super("load")
end

function rank_list:on_injected()
    self.list:attach(self.scroll_view);
end

return rank_list